package org.openea.eap.module.obpm.util.form;

import jxl.biff.DisplayFormat;
import jxl.format.Alignment;
import jxl.format.CellFormat;
import jxl.write.*;


















public abstract class JxlUtils
{
  public static final int DEF_FONT_SIZE = 10;
  public static final int TITLE_FONT_SIZE = 16;
  public static final int SUB_TITLE_FONT_SIZE = 12;

  public static WritableCellFormat createTitleFormat() {
    WritableCellFormat wcf = new WritableCellFormat(new WritableFont(WritableFont.TAHOMA, 16, WritableFont.BOLD));

    try {
      wcf.setAlignment(Alignment.CENTRE);
    } catch (WriteException e) {
      e.printStackTrace();
    }

    return wcf;
  }






  public static CellFormat createColumnFormat() { return (CellFormat)new WritableCellFormat(new WritableFont(WritableFont.TAHOMA, 10, WritableFont.BOLD)); }







  public static CellFormat createMoneyFormat() { return (CellFormat)new WritableCellFormat((DisplayFormat)new NumberFormat("#,###,###,##0.00")); }







  public static CellFormat createNumberFormat() { return (CellFormat)new WritableCellFormat((DisplayFormat)new NumberFormat("0.00")); }







  public static CellFormat createIntFormat() { return (CellFormat)new WritableCellFormat((DisplayFormat)new NumberFormat("0")); }







  public static CellFormat createDatetimeFormat() { return (CellFormat)new WritableCellFormat((DisplayFormat)new DateFormat("yyyy-MM-dd HH:mm:ss")); }







  public static CellFormat createDateFormat() { return (CellFormat)new WritableCellFormat((DisplayFormat)new DateFormat("yyyy-MM-dd")); }







  public static CellFormat createTimeFormat() { return (CellFormat)new WritableCellFormat((DisplayFormat)new DateFormat("HH:mm:ss")); }
}
